# 17级智能移动班 李翔宇  17114120208
RANKS = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
SUITS = ['梅花', '方片', '红桃', '黑桃']
D = {}


class Card:
    def __init__(self, rank, suit):
        self.rank = rank
        self.suit = suit


class play:
    @staticmethod
    def string():  # 洗牌
        for i in range(52):
            if (i/13 < 1):
                suit = SUITS[0]
                rank = RANKS[i]
            elif (i/13 >= 1 and i/13 < 2):
                suit = SUITS[1]
                rank = RANKS[i-13]
            elif (i/13 >= 2 and i/13 < 3):
                suit = SUITS[2]
                rank = RANKS[i-26]
            elif (i/13 >= 3):
                suit = SUITS[3]
                rank = RANKS[i-39]
            D[i] = Card(rank, suit)

    @staticmethod
    def shun(a):  # 整理牌
        B = {}
        for i in range(13):
            B[i] = D[i+a]
        return B


class Hand:
    def __init__(self, cards):
        self.cards = cards

    def __str__(self):  # 输出手里的牌
        str1 = ''
        for i in range(13):
            str1 = str1+self.cards[i].suit+self.cards[i].rank+'\t'
        return str1


play.string()  # 洗牌
print(Hand(play.shun(0)))
print(Hand(play.shun(13)))
print(Hand(play.shun(26)))
print(Hand(play.shun(39)))